﻿using System.Windows.Controls;
using Dsl.Ped.Framework.WPFControls;

namespace Dsl.Ped.Framework.Helpers 
{
    /// <summary>
    /// Helper methods for <see cref="ControlTemplate"/>
    /// </summary>
    public class TemplateHelper 
    {
        /// <summary>
        /// Get the template for the error validations
        /// </summary>
        /// <returns></returns>
        public static ControlTemplate GetValidationErrorTemplate()
        {
            // Kind of tricky, template is taken via the instance of dummy user control
            // in the same Assembly
            var dummy = new Dummy();
            var template = dummy.TryFindResource("ValidationErrorTemplate");

            return template as ControlTemplate;
        }
    }
}
